// JavaScript Document

function getSetTimeParamsSqlExp()
{
	
	
		var paramsql=" update \"ez_flow_timeparam\" ";
		
			var time_exp_arr=new Array();
			if($("#starttime").val())
			{
				var time_exp1="   \"starttime\"=to_timestamp('@start@', 'yyyy-mm-dd')  ";
				time_exp1=time_exp1.replace("@start@",$("#starttime").val());
				time_exp_arr.push(time_exp1);
			}
			if($("#endtime").val())
			{
			var	time_exp2="   \"endtime\"=to_timestamp('@end@', 'yyyy-mm-dd')  ";
				time_exp2=time_exp2.replace("@end@",$("#endtime").val());
				time_exp_arr.push(time_exp2);
			}
				var time_exp=time_exp_arr.join(",");
			if(time_exp.length>0)
				paramsql=paramsql+" set "+time_exp;
			else
				paramsql=" update \"ez_flow_timeparam\" set  \"starttime\"=null, \"endtime\"=null ";
				//paramsql=" update \"ez_flow_timeparam_blank\" set  \"starttime\"=null ";
				//	paramsql=paramsql+" set  \"starttime\"=to_timestamp('', 'yyyy-mm-dd'), \"endtime\"=to_timestamp('@end@', 'yyyy-mm-dd') ";
				return paramsql;
				
}

function toWorktime(day)
{
	return toDecimal2(day*8);
	
}

//绑定翻页查询数据事件-->

function getTestdata()
{
	var a=new Array();
	for(i=1;i<99;i++)
	{
	a.push(i);	
	}
	return a ;
	
}
function  showCurPageData2Table(cur_page_datas)
{
	VueObj1.$data.list_data1=cur_page_datas;
	
}
function   clrOldPageData()
{
	VueObj1.$data.list_data1=[];
	
}
var all_data=getTestdata();//获取数据，可以一般是从后台ajax获取。。前段分页是获取所有数据，后端分页只获取当前页数据

function onSelectPageEvent(pageNumber, pageSize)
{
	
	 	   
			   clrOldPageData();//清空现有显示数据
			   $(this).pagination('loading');
			   window.setTimeout(function(){
				      //截取当前页面数据
					  var cur_page_datas=getCurPageDatas(all_data2,pageNumber,pageSize);
					  //显示截取数据到界面
					  showCurPageData2Table(cur_page_datas);
					   $("#page_div").pagination('loaded');
				   
				   },500);// timeout end
				   
				   
				  
			
				
		 
	
}
var all_data2;
function setPageControl(all_data)
{
	all_data2=all_data;
	//设置翻页
	$('#page_div').pagination({
		pageList:[10,20,50,100,150,200,300,400,500,600,700,800,900,1000],
		total:all_data.length,
		pageSize:10,
		onSelectPage: onSelectPageEvent
	});  //pagination end 
	$('#page_div').pagination('select', 1);//转到第一页
	 
	
 
}
var testdata2=[{"流程名":"梦洁新开加盟资格审批流程","平均时间":8.13,"PROC_DEF_ID_":"MJ-MK-0028:30:12667200","延误数量":4,"总数量":5,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"子（分）公司名称预先核准申请流程","平均时间":6.52,"PROC_DEF_ID_":"MJ-MK-0056:8:15136555","延误数量":3,"总数量":7,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"梦洁营销直营终端（店）设立评审流程","平均时间":50.14,"PROC_DEF_ID_":"MJ-MK-0022:36:19443535","延误数量":10,"总数量":27,"上个月平均执行时间":0,"前三月平均时间":64.91,"前三月提速率":22.77},{"流程名":"子（分）公司名称预先核准申请流程","平均时间":5.01,"PROC_DEF_ID_":"MJ-MK-0056:6:14501287","延误数量":1,"总数量":6,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"子（分）公司名称预先核准申请流程","平均时间":48.3,"PROC_DEF_ID_":"MJ-MK-0056:5:12470412","延误数量":1,"总数量":4,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"梦洁营销直营终端（店）设立评审流程","平均时间":54.15,"PROC_DEF_ID_":"MJ-MK-0022:30:12675855","延误数量":1,"总数量":8,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"梦洁营销直营终端（店）设立评审流程","平均时间":11.21,"PROC_DEF_ID_":"MJ-MK-0022:34:15136464","延误数量":5,"总数量":8,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"梦洁整改申请审批流程","平均时间":10.64,"PROC_DEF_ID_":"MJ-MK-0039:28:28031586","延误数量":2,"总数量":2,"上个月平均执行时间":0,"前三月平均时间":10.64,"前三月提速率":0},{"流程名":"梦洁整改申请审批流程","平均时间":6.64,"PROC_DEF_ID_":"MJ-MK-0039:25:12563637","延误数量":1,"总数量":1,"上个月平均执行时间":0,"前三月平均时间":0},{"流程名":"梦洁整改申请审批流程","平均时间":5.82,"PROC_DEF_ID_":"MJ-MK-0039:27:13205082","延误数量":35,"总数量":55,"上个月平均执行时间":0,"前三月平均时间":8.28,"前三月提速率":29.72},{"流程名":"梦洁新开加盟资格审批流程","平均时间":6.79,"PROC_DEF_ID_":"MJ-MK-0028:33:25993845","延误数量":4,"总数量":10,"上个月平均执行时间":0,"前三月平均时间":6.79,"前三月提速率":0},{"流程名":"梦洁新开加盟资格审批流程","平均时间":6.99,"PROC_DEF_ID_":"MJ-MK-0028:41:29509439","延误数量":3,"总数量":6,"上个月平均执行时间":4.72,"上月提速率":-48.12,"前三月平均时间":4.72,"前三月提速率":-48.12},{"流程名":"子（分）公司名称预先核准申请流程","平均时间":6.23,"PROC_DEF_ID_":"MJ-MK-0056:15:29505771","延误数量":1,"总数量":1,"上个月平均执行时间":6.23,"上月提速率":0,"前三月平均时间":6.23,"前三月提速率":0},{"流程名":"子（分）公司名称预先核准申请流程","平均时间":71.73,"PROC_DEF_ID_":"MJ-MK-0056:9:19443700","延误数量":3,"总数量":13,"上个月平均执行时间":186.03,"上月提速率":61.44,"前三月平均时间":64.67,"前三月提速率":-10.92},{"流程名":"梦洁新开加盟资格审批流程","平均时间":16.46,"PROC_DEF_ID_":"MJ-MK-0028:32:16974506","延误数量":58,"总数量":145,"上个月平均执行时间":252.83,"上月提速率":93.49,"前三月平均时间":69.75,"前三月提速率":76.4},{"流程名":"梦洁新开加盟资格审批流程","平均时间":17.51,"PROC_DEF_ID_":"MJ-MK-0028:31:13772140","延误数量":25,"总数量":41,"上个月平均执行时间":338.35,"上月提速率":94.83,"前三月平均时间":338.35,"前三月提速率":94.83}];
 
    